(function($){
$(function(){

// 单页面导航初始化
$('#nav').onePageNav({
    currentClass: 'active',
    changeHash: false,
    scrollSpeed: 750,
    scrollThreshold: 0.5,
    filter: ':not(.contact)',
    easing: 'swing',
    begin: function() {
        //I get fired when the animation is starting
    },
    end: function() {
        //I get fired when the animation is ending
    },
    scrollChange: function(ev) {
        //I get fired when you enter a section and I pass the list item of the section
    }
});

$(window).scroll(function(){
    //获取窗口的滚动条的垂直位置
    var scrollTop = $(window).scrollTop();
    //当窗口的滚动条的垂直位置大于页面的最小高度时，让返回顶部元素渐现，否则渐隐
    console.log(scrollTop);
    if( scrollTop > 100){
        $("#nav").addClass("fixed");
    }else{
        $("#nav").removeClass("fixed");
    };
});


});
})(jQuery);
